import request from "@/utils/request";
import {
  ResManagerList,
  reqManagerAddParams,
  reqManagerEditParams,
} from "./model";
// 获取管理员列表
export const reqManagerList = (data: PageQuery) => {
  return request<any, PageResult<ResManagerList[]>>({
    url: "/admin/managerlist",
    params: data,
  });
};
// 添加管理员
export const reqManagerAdd = (data: reqManagerAddParams) => {
  return request({
    url: "/admin/managercreate",
    method: "post",
    data,
  });
};
// 删除管理员
export const reqManagerDel = (id: string | number) => {
  return request({
    url: "/admin/managerdelete",
    params: { id },
  });
};
//编辑管理员
export const reqManagerEdit = (data: reqManagerEditParams) => {
  return request({
    url: "/admin/upmanager",
    method: "post",
    data,
  });
};
